<?php

require_once dirname(__FILE__).'/../lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php';
sfCoreAutoload::register();

class ProjectConfiguration extends sfProjectConfiguration
{
  public function setup()
  {
	  
    $this->enablePlugins('sfCaptchaGDPlugin');
	 
    $this->enablePlugins('sfDoctrinePlugin');
    $this->enablePlugins('sfImageTransformPlugin');
        
    $this->enablePlugins('sfDoctrineGuardPlugin');
    $this->enablePlugins('sfFormExtraPlugin');
    
    $this->enablePlugins('sfInvoiceGenerationPlugin');
    //$this->enablePlugins('sfFirePHPPlugin');
    
    $this->enablePlugins('sfFacebookConnectPlugin');
    $this->enablePlugins('sfSyncPlugin');
    $this->enablePlugins('sfMinifyTSPlugin');


  }
  
  	public function configureDoctrine(Doctrine_Manager $manager){
		

//		$cacheDB = sfConfig::get('sf_web_dir') . '/uploads/cache.sq';
//		$cacheConn = Doctrine_Manager::connection(new PDO("sqlite:{$cacheDB}"));
//		$cacheDriver = new Doctrine_Cache_Db(array('connection' => $cacheConn, 'tableName' =>'cache'));
//		$cacheDriver->createTable();

//		$servers = array(
//			'host' => 'localhost',
//			'port' => 11211,
//			'persistent' => true
//		);
//
//		$cacheDriver = new Doctrine_Cache_Memcache(array(
//				'servers' => $servers,
//				'compression' => false
//			)
//		);

//		$manager->setAttribute(Doctrine_Core::ATTR_QUERY_CACHE, $cacheDriver);

  		$options = array('baseClassName' => 'BaseDoctrineRecord');
  		sfConfig::set('doctrine_model_builder_options', $options);
		$manager->setCollate('utf8_unicode_ci');
  		$manager->setCharset('utf8');
	}
	

  ## ZEND
  static protected $zendLoaded = false;
 
  static public function registerZend()
  {
  	
    if (self::$zendLoaded)
    {
      return;
    }
 
    set_include_path(sfConfig::get('sf_lib_dir').'/vendor'.PATH_SEPARATOR.get_include_path());
    require_once sfConfig::get('sf_lib_dir').'/vendor/Zend/Loader/Autoloader.php';
    Zend_Loader_Autoloader::getInstance();
    self::$zendLoaded = true;


		Zend_Search_Lucene_Analysis_Analyzer::setDefault(
  new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8_CaseInsensitive ()); 
  }

  
}
